<?php
    session_start();
    require_once('../includes/DbConnector.php');
    
     if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
        $loggedIn = false;
        echo 'notloggedin';
    } else{
        $userid = $_SESSION['userId'];
        $loggedIn = true;
    }
    
    if($loggedIn === true){
        if(isset($_GET['action']) && !empty($_GET['action'])) {
            // INPUT DATA.
            $action = $_GET['action'];
            $connector  = new DbConnector();
            $sql = "select '$userid' user_id from dual";
            $result = $connector->query($sql);
            
            $a = mysql_fetch_assoc($result);

            echo json_encode($a);
        }
    }
    
?>